package com.erp.dto;

import java.util.Date;

import com.erp.domain.TArticle;
import com.erp.mapping.ArticleType;
import com.erp.mapping.Status;

@SuppressWarnings("serial")
public class Article implements java.io.Serializable {

	private Integer id;
	private String content;// 内容

	private User author;// 作者
	private Date postTime;// 发表时间
	private String ipAddr;// 发表文章时所用的IP地址
	protected ArticleType articleType = ArticleType.TYPE_COMMON;// 文章类型，默认一般类型
	protected Status status = Status.STATUS_NORMAL;// 文章状态，默认正常状态

	public Article() {
	}

	/**
	 * author属性逻辑层控制
	 * 
	 * @param tArticle
	 */
	public Article(TArticle tArticle) {
		this.id = tArticle.getId();
		this.content = tArticle.getContent();
		this.author = new User(tArticle.getAuthor());
		this.postTime = tArticle.getPostTime();
		this.ipAddr = tArticle.getIpAddr();
		this.articleType = tArticle.getArticleType();
		this.status = tArticle.getStatus();
	}

	/*
	 * public Article(Integer id, String title, String content, String faceIcon,
	 * User author, Date postTime, String ipAddr) { this.id = id; this.title =
	 * title; this.content = content; this.faceIcon = faceIcon; this.author =
	 * author; this.postTime = postTime; this.ipAddr = ipAddr; }
	 */
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public User getAuthor() {
		return author;
	}

	public void setAuthor(User author) {
		this.author = author;
	}

	public Date getPostTime() {
		return postTime;
	}

	public void setPostTime(Date postTime) {
		this.postTime = postTime;
	}

	public String getIpAddr() {
		return ipAddr;
	}

	public void setIpAddr(String ipAddr) {
		this.ipAddr = ipAddr;
	}

	public ArticleType getArticleType() {
		return articleType;
	}

	public void setArticleType(ArticleType articleType) {
		this.articleType = articleType;
	}

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status =status;
	}

}
